home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / lang / ace102.lha / include / sys_req.h < prev    next >
C/C++ Source or Header  |  1993-01-30  |  994b  |  45 lines

  1. { Invoke a system requester using AutoRequest().
  2.   
  3.   Date: 13th January 1993 }
  4.  
  5. #include <intuition.h>
  6.  
  7. SUB fill_intuitext(textaddr&,left%,top%,msg$)
  8. declare struct IntuiText *txt
  9.  
  10.   txt = textaddr&
  11.   
  12.   txt->FrontPen  = 0
  13.   txt->BackPen   = 1
  14.   txt->DrawMode  = JAM1
  15.   txt->LeftEdge  = left%
  16.   txt->TopEdge   = top%
  17.   txt->ITextFont = NULL
  18.   txt->IText     = @msg$
  19.   txt->NextText  = NULL
  20. END SUB
  21.  
  22. SUB system_request(body$,positive$,negative$)
  23. declare function AutoRequest% library intuition
  24. declare struct IntuiText main
  25. declare struct IntuiText pprompt
  26. declare struct IntuiText nprompt
  27.  
  28.   '..width of requester
  29.   '..(assumes topaz)
  30.   req.x% = len(body$)*8 + 20    
  31.  
  32.   '..create main message and two option messages 
  33.   fill_intuitext(main,req.x%\2+10,25,body$)
  34.   fill_intuitext(pprompt,5,5,positive$)
  35.   fill_intuitext(nprompt,5,5,negative$)
  36.  
  37.   library intuition
  38.  
  39.   res% = AutoRequest(window(7),main,pprompt,nprompt,NULL,NULL,req.x%,50)
  40.  
  41.   library close intuition
  42.  
  43.   system_request=res%
  44. END SUB
  45.